import {Modal} from 'antd';
import {Map, Marker} from "react-bmap";
import React from 'react';

class ModalMap extends React.Component {

  render() {
    const {pointPosition, visible, onClose} = this.props;
    return (
      <div>
        <Modal
          title={`坐标: ${pointPosition !== null && Object.values(pointPosition).join(', ')}`}
          visible={visible}
          // onOk={onClose}
          destroyOnClose={true}
          onCancel={onClose}
          footer={null}
        >
          <Map center={pointPosition} zoom="14" enableScrollWheelZoom={true}>
            <Marker position={pointPosition}/>
          </Map>
        </Modal>
      </div>
    );
  }
}

export default ModalMap;
